const Base = require('../common/base.js');

module.exports = class extends Base {
	constructor(ctx) {
		super(ctx);
		this.wbuser = this.appModel("user", "wxbot");
		this.user_level = this.model("sys_user_level");
		this.instr = "huitaor";
	}

	async indexAction() {
		if(this.isGet) {
			let levels = await this.user_level.select();

			console.log(levels);
			this.assign("userLevels", levels);
			return this.appDisplay();
		}

		let posts = this.post();

		let where = {};
		const data = await this.wbuser.joinAssetTable(posts, where,"id,wxid,nickname,create_time,times,user_id,setup_id");
		console.log(data)
		return this.json(data);

	}
	

};